/*
    地图界面
 */

import React from "react";
import { Text, View, Button } from "react-native";
import DialogModal from "../../../core/modal/dialog/DialogModal";
import { BProps, BState, HeaderView } from "../../index";

interface IState extends BState {
  dataSource: any;
  isShowDialog: boolean;
}

export default class MapViewComponent extends React.Component<BProps, IState> {
  constructor(props: BProps) {
    super(props);
    this.state = {
      dataSource: null,
      isShowDialog: false,
    };
  }

  render() {
    return (
      <View style={{ flex: 1,width:"100%",height:"100%" }}>
        <HeaderView
          componentId={this.props.componentId}
          title={this.props.title}
        />
        <Text>Settings!</Text>
        <DialogModal
          content={"确定删除个人信息吗？"}
          confirm={this.ensureDialog}
          cancel={this.cancelDialog}
          visible={this.state.isShowDialog}
        />
        <Button
          onPress={() => {
            this.setState({ isShowDialog: true });
          }}
          title="点击我"
          color="#841584"
        />
      </View>
    );
  }

  // 确认
  ensureDialog = () => {
    this.setState({ isShowDialog: false });
  };

  //取消
  cancelDialog = () => {
    this.setState({ isShowDialog: false });
  };
}
